1. Field of the Invention
An aspect of the present invention relates to at least one of a device, a method, and a non-transitory computer-readable recording medium.
2. Description of the Related Art
Conventionally, a technique has been known for imaging, from different viewpoints, an object to be measured on which light with a predetermined pattern has been projected, to measure a three-dimensional shape of such an object to be measured.
Such a three-dimensional measurement is such that a correspondence between a projected pattern and an imaged pattern is executed and subsequently a distance to an object to be measured is calculated in accordance with a principle of triangulation. For such a calculation, an internal parameter (such as a focal length, a position of an optical axis, or a lens distortion) and an outer parameter (such as a relative position/attitude between a projection device and an imaging device) of an optical system for any of a projection device and an imaging device are needed.
Acquiring a parameter as described above preliminarily is referred to as calibration. For a method of this calibration, there are a method for preliminarily executing calibration by using a dedicated calibration object that has a known shape, and a method for simultaneously executing calibration at a time of measurement by using an object to be measured, per se, (self-calibration method). According to this self-calibration method, a preliminary calibration operation that uses a dedicated calibration object is not required and there is an advantage of being able to deal with a secular change of a system flexibly, so that a variety of studies have been conducted in recent years.
For such a self-calibration method, Japanese Patent Application Publication No. 2005-326247 discloses a method that extracts a plurality of planar areas from an object to be measured, subsequently derives a plane projection matrix H between a projection image and an imaging image based on 4 or more corresponding points on each plane, and obtains a parameter as a solution of a linear programming problem based on a plurality of derived plane projection matrices H1, H2, . . . Hn. However, it is not possible to apply a method in Japanese Patent Application Publication No. 2005-326247 to a case where an object to be measured does not have a planar area (for example, a case where an object to be measured is composed of a curved surface).
In this respect, Japanese Patent No. 4230525 discloses a method that defines an error function in such a manner that a distance in a three-dimensional space between a line of sight that is directed from a projector to a projection point on an object to be measured (a first straight line) and a line of sight that is directed from a camera to such a projection point (a second straight line) is a minimum in a case where the camera and the projector satisfy an epipolar constraint with respect to such a projection point and further estimates a parameter for minimizing such an error function in accordance with a non-linear programming method.
However, a self-calibration method disclosed in Japanese Patent No. 4230525 uses an error function that presupposes an epipolar constraint, and hence, there is a problem that it is not possible to be applied to a case where an optical system of a projector or a camera deviates from a pinhole model (for example, a case where a short focus projector or an omnidirectional camera is used).